package com.ruoyi.production.vo;

import cn.hutool.core.codec.Base64;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;

/**
 * @Author:
 * @createTime: 2022年09月06日 10:14:12
 * @Description: 构件vo
 */
public class CompomentQrVO {
    //浙江永坚新新材料科技股份有限公司
    private String name;
    //构件编号
    private String assemblyNumber;
    //项目
    private String project;
    //构件名称
    private String componentName;
    //楼层号
    private String buildNo;
    //重量
    private String floor;
    //重量
    private String weight;
    //规格
    private String specification;
    //长度
    private String length;


    public static CompomentQrVO  getCompomentQrVO(String assemblyNumber, String project, String componentName, String buildNo, String floor, String weight, String specification, String length) {
        CompomentQrVO compomentQrVO = new CompomentQrVO();
        compomentQrVO.setName("浙江永坚新新材料科技股份有限公司");
        compomentQrVO.setAssemblyNumber(assemblyNumber);
        compomentQrVO.setProject(project);
        compomentQrVO.setComponentName(componentName);
        compomentQrVO.setBuildNo(buildNo);
        compomentQrVO.setFloor(floor);
        compomentQrVO.setWeight(weight);
        compomentQrVO.setSpecification(specification);
        compomentQrVO.setLength(length);
        return compomentQrVO;
    }

    public String getBase64(){
        return Base64.encode(toString());
    }
    public ArrayList<String> getList(){
        ArrayList<String> text = new ArrayList<>();
        text.add("浙江永坚新新材料科技股份有限公司");
        text.add("构件编号: " + getAssemblyNumber());
        text.add("项目: " + getProject());
        text.add("构件名称: "  + getComponentName());
        text.add("楼层号: " + getBuildNo() + getFloor());
        text.add("重量（KG）: " + getWeight());
        text.add("规格: " + getSpecification());
        text.add("长度: " + getLength());
        return text;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAssemblyNumber() {
        if (StringUtils.isBlank(assemblyNumber)){
            return "";
        }
        return assemblyNumber;
    }

    public void setAssemblyNumber(String assemblyNumber) {
        this.assemblyNumber = assemblyNumber;
    }

    public String getProject() {
        if (StringUtils.isBlank(project)){
            return "";
        }
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getComponentName() {
        if (StringUtils.isBlank(componentName)){
            return "";
        }
        return componentName;
    }

    public void setComponentName(String componentName) {
        this.componentName = componentName;
    }

    public String getBuildNo() {
        if (StringUtils.isBlank(buildNo)){
            return "";
        }
        return buildNo;
    }

    public void setBuildNo(String buildNo) {
        this.buildNo = buildNo;
    }

    public String getFloor() {
        if (StringUtils.isBlank(floor)){
            return "";
        }
        return floor;
    }

    public void setFloor(String floor) {
        this.floor = floor;
    }

    public String getWeight() {
        if (StringUtils.isBlank(weight)){
            return "";
        }
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getSpecification() {
        if (StringUtils.isBlank(specification)){
            return "";
        }
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public String getLength() {
        if (StringUtils.isBlank(length)){
            return "";
        }
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    @Override
    public String toString() {
        return "CompomentQrVO{" +
                "name='" + name + '\'' +
                ", assemblyNumber='" + assemblyNumber + '\'' +
                ", project='" + project + '\'' +
                ", componentName='" + componentName + '\'' +
                ", buildNo='" + buildNo + '\'' +
                ", floor='" + floor + '\'' +
                ", weight='" + weight + '\'' +
                ", specification='" + specification + '\'' +
                ", length='" + length + '\'' +
                '}';
    }
}
